﻿#region Copyright and License
/*==============================================================================
 *  Copyright (c) cndotnet.org Corporation.  All rights reserved.
 * ===============================================================================
 * This code and information is provided "as is" without warranty of any kind,
 * either expressed or implied, including but not limited to the implied warranties
 * of merchantability and fitness for a particular purpose.
 * ===============================================================================
 * Licensed under the GNU General Public License (GPL) v2
 * http://www.cndotnet.org/ucenter
 * ==============================================================================*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using UCenter.Core.Model;

namespace UCenter.EmailService.Models
{
    /// <summary>
    /// The entity of email waiting item.
    /// </summary>
    [Table(Name = "EmailWaitQueue")]
    public class MailWaitItem : EntityBase
    {
        #region Private Fields

        private int _Id;

        private short _mailType;

        private string _recipient;

        private short _priority;

        private string _subject;

        private string _content;

        private DateTime? _createDate;

        private short _retries;

        private DateTime? _sentDate;

        #endregion

        #region Public Properties

        /// <summary>
        /// Gets or sets the ID.
        /// </summary>
        /// <value>The ID.</value>
        [Column(Name = "ID", IsPrimaryKey = true, IsDbGenerated = true)]
        public int ID
        {
            get
            {
                return _Id;
            }
            set
            {
                if (_Id != value)
                {
                    this.SendPropertyChanging("ID");
                    this._Id = value;
                    this.SendPropertyChanged("ID", value);
                }
            }
        }

        /// <summary>
        /// Gets or sets the type of the mail.
        /// </summary>
        /// <value>The type of the mail.</value>
        [Column(Name = "MailType")]
        public short MailType
        {
            get
            {
                return _mailType;
            }
            set
            {
                if (_mailType != value)
                {
                    this.SendPropertyChanging("MailType");
                    this._mailType = value;
                    this.SendPropertyChanged("MailType", value);
                }
            }
        }

        /// <summary>
        /// Gets or sets the recipient.
        /// </summary>
        /// <value>The recipient.</value>
        [Column(Name = "Recipient")]
        public string Recipient
        {
            get
            {
                return _recipient;
            }
            set
            {
                if (_recipient != value)
                {
                    this.SendPropertyChanging("Recipient");
                    this._recipient = value;
                    this.SendPropertyChanged("Recipient", value);
                }
            }
        }

        /// <summary>
        /// Gets or sets the priority.
        /// </summary>
        /// <value>The priority.</value>
        [Column(Name = "Priority")]
        public short Priority
        {
            get
            {
                return _priority;
            }
            set
            {
                if (_priority != value)
                {
                    this.SendPropertyChanging("Priority");
                    this._priority = value;
                    this.SendPropertyChanged("Priority", value);
                }
            }
        }

        /// <summary>
        /// Gets or sets the subject.
        /// </summary>
        /// <value>The subject.</value>
        [Column(Name = "Subject")]
        public string Subject
        {
            get
            {
                return _subject;
            }
            set
            {
                if (_subject != value)
                {
                    this.SendPropertyChanging("Subject");
                    this._subject = value;
                    this.SendPropertyChanged("Subject", value);
                }
            }
        }

        /// <summary>
        /// Gets or sets the content.
        /// </summary>
        /// <value>The content.</value>
        [Column(Name = "Content")]
        public string Content
        {
            get
            {
                return _content;
            }
            set
            {
                if (_content != value)
                {
                    this.SendPropertyChanging("Content");
                    this._content = value;
                    this.SendPropertyChanged("Content", value);
                }
            }
        }

        /// <summary>
        /// Gets or sets the create date.
        /// </summary>
        /// <value>The create date.</value>
        [Column(Name = "CreateDate")]
        public DateTime? CreateDate
        {
            get
            {
                return _createDate;
            }
            set
            {
                if (_createDate != value)
                {
                    this.SendPropertyChanging("CreateDate");
                    this._createDate = value;
                    this.SendPropertyChanged("CreateDate", value);
                }
            }
        }

        /// <summary>
        /// Gets or sets the retries.
        /// </summary>
        /// <value>The retries.</value>
        [Column(Name = "Retries")]
        public short Retries
        {
            get
            {
                return _retries;
            }
            set
            {
                if (_retries != value)
                {
                    this.SendPropertyChanging("Retries");
                    this._retries = value;
                    this.SendPropertyChanged("Retries", value);
                }
            }
        }

        /// <summary>
        /// Gets or sets the sent date.
        /// </summary>
        /// <value>The sent date.</value>
        [Column(Name = "SentDate")]
        public DateTime? SentDate
        {
            get
            {
                return _sentDate;
            }
            set
            {
                if (_sentDate != value)
                {
                    this.SendPropertyChanging("SentDate");
                    this._sentDate = value;
                    this.SendPropertyChanged("SentDate", value);
                }
            }
        }

        #endregion
    }
}
